package com.net.shop.car.manager.api.volley.response.dingdan;

import org.json.JSONException;
import org.json.JSONObject;

import com.net.shop.car.manager.api.model.TuikuanDingdetail;
import com.net.shop.car.manager.api.volley.Response;
import com.net.shop.car.manager.utils.Constants;
import com.net.shop.car.manager.utils.StringUtils;

public class DingdanTuikuanDetailResponse extends Response {
	
	private TuikuanDingdetail tuikuanDingdetail;
	
	public DingdanTuikuanDetailResponse() {
		super(Constants.DINGDAN_TUIKUN_DETAIL);
	}
	
	@Override
	public String getContentTag() {
		return "detail";
	}
	@Override
	public void parseContent(String content) {
		try {
			JSONObject jsonObject = new JSONObject(content);
			tuikuanDingdetail = new TuikuanDingdetail();
			tuikuanDingdetail.setCreateDate(StringUtils.filterNull(jsonObject
					.getString("CREATE_DATE")));
			tuikuanDingdetail.setGoodName(StringUtils.filterNull(jsonObject
					.getString("GOOD_NAME")));
			tuikuanDingdetail.setId(StringUtils.filterNull(jsonObject
					.getString("ID")));
			tuikuanDingdetail.setOrderId(StringUtils.filterNull(jsonObject
					.getString("ORDER_ID")));
			tuikuanDingdetail.setRefundDetail(StringUtils.filterNull(jsonObject
					.getString("REFUND_DESC")));
			tuikuanDingdetail.setRefundState(StringUtils
					.filterIntegerNull(jsonObject
							.getString("REFUND_STATE")));
			tuikuanDingdetail.setBankCard(StringUtils.filterNull(jsonObject
					.getString("BANK_CARD")));
			tuikuanDingdetail.setBankName(StringUtils.filterNull(jsonObject
					.getString("BANK_NAME")));
			tuikuanDingdetail.setBankOpen(StringUtils.filterNull(jsonObject
					.getString("BANK_OPEN")));
			tuikuanDingdetail.setZfb(StringUtils.filterNull(jsonObject
					.getString("ZFB")));
			
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public TuikuanDingdetail getTuikuanDingdetail() {
		return tuikuanDingdetail;
	}

}
